package com.bosssoft.trainee.nontax.entity.vo;

import lombok.*;
import org.hibernate.validator.constraints.Length;
import org.springframework.stereotype.Component;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.Pattern;


@Component
@Builder
@Setter
@Getter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(of={"userId"})
public class UserVo {
    @Null
    private Integer userId;

    @NotNull
    private String name;

    @Length(min = 6,max = 16)
    private String password;

    @Pattern(regexp = "^(13\\d|17\\d|14[5|7]|15\\d|18\\d|19[4|5])\\d{8}$")
    private String tel;

    @Pattern(regexp = "^[1-9]\\d{5}(?:18|19|20)\\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\\d|30|31)\\d{3}[\\dXx]$")
    private String idNo;

    @NotNull
    private String deptName;

    @NotNull
    private String address;

    @Pattern(regexp = "\\w{4,20}@(163|126|qq).com$")
    private String email;

    @NotNull
    private String birth;

    @NotNull
    private String sex;

    @Pattern(regexp = "[1-9]\\d{4,}")
    private String qq;

    private String description;

    private String createTime;

    private int isValid;
}
